package kevin.newmybatis;

import kevin.newmybatis.mybatis.*;
import kevin.newmybatis.mybatis.config.MyConfiguration;
import kevin.newmybatis.mybatis.executor.MyExecutor;
import kevin.newmybatis.mybatis.executor.MyExecutorImpl;
import kevin.newmybatis.mybatis.session.SqlSession;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {


        //创建 congifruation对象加载对于的mapper
        MyConfiguration configuration = new MyConfiguration();
        //创建executor操作数据库
        MyExecutor executor = new MyExecutorImpl();

        //创建Manager会话指定操作
        SqlSession session = new SqlSession(configuration,executor);
        //得到指定mapper
        UserMapper userMapper =session.getMapper(UserMapper.class);
        //调用查询
        System.out.println( userMapper.getFindById(1).toString());

    }
}
